﻿using Core;
using System.Text.RegularExpressions;
using UnityEngine;
using UnityEngine.UI;

public class LanguageText : MonoBehaviour
{
    private Text txt;
    private string srcStr;
    public void Awake()
    {
        txt = GetComponent<Text>();
        srcStr = txt.text;
    }

    public void Start()
    {
        if (txt == null || srcStr != txt.text)
        {
            return;
        }

        var str = Regex.Replace(txt.text, @"\s", "");
        txt.text = L.T(str);
    }
}
